package com.eudon.design_pattern.structural.bridge.before;

import com.eudon.design_pattern.structural.bridge.Error;

import java.util.ArrayList;
import java.util.List;

/**
 * @author eudon
 * @description 通知
 * @date 2025/9/1
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public class Notification {
    private List<String> weChat = new ArrayList<>();
    private List<String> emails = new ArrayList<>();
    private List<String> telephones = new ArrayList<>();

    public boolean send(Error error) {
        try {
            if (error == Error.SERVER) {
                //打电话通知开发
            }else if (error == Error.BUG){
                //发微信通知
            }else if (error == Error.WARN){
                //发邮件通知
            }else {
                //...
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }
}
